/*
 *  Cero Project - Copyright   2006 The Cero Developement Team 
 *  (Michael Laguerre, Camille Roux, Matthieu Segret, Mathieu Sivade) 
 * 
 *  This program is free software; you can redistribute it and/or modify it 
 *  under the terms of the GNU General Public License as published by the Free 
 *  Software Foundation; either version 2 of the License, or (at your option) 
 *  any later version.
 * 
 *  This program is distributed in the hope that it will be useful, but 
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
 *  for more details.
 */

package org.ceroproject.ui.commandline;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Impl�mentation de LecteurEntree lisant l'entr�e standard depuis la console
 * 
 * @author Camille Roux
 * @see zuul.ui.InputReader
 */
public class StandardInput implements InputReader {
	/** Lecteur stockant les donn�es �crites */
	BufferedReader console;

	public StandardInput() {
		console = new BufferedReader(new InputStreamReader(System.in));
	}

	/**
	 * Renvoie les donn�es saisies sur la console
	 * 
	 * @return les donn�es saisies sur la console
	 */
	public String readLine() {
		String retour;
		retour = null;
		try {
			retour = console.readLine();
		} catch (IOException e) {
			// d�conne s�rieuse ici : impossible de lire l'entr�e standard ?
		}
		return retour;
	}
}
